Analisis Tingkat Pelanggan Kembali pada Outback


In [28]:
library(ggplot2)
library(MASS)
library(reshape2)
library(corrplot)
library(plyr)
library(mgcv)
library(sm)
library(vars)
library(lattice)
library(R2HTML)
library(knitr)
library(IRkernel)
options(repr.plot.width = 7)
options(repr.plot.height = 5)

Data Outback:


In [29]:
DataOutback <-read.csv("Outback.csv", header=TRUE, sep=",") 
DataOutback


Out[29]:
RROTampilanOMenuOPackagingOWifiOPembayaranOPelayananO
13444444
23444344
35555555
44443334
55444435
64444444
73444444
83444444
93444344
103444344
115455345
124444444
133554455
143544444
154444444
164111444
173444444
183445354
194444224
202554434
213444444
224444453
233444344
243443344
254444444
263444444
273224444
283345344
292444224
302444445
314444444
325554554
332444444
344554445
354555555
365445444
374555555
384444444
393433344
403445454
413333333
423333333
433444444
444444444
452333333
463433333
472333232
483444244
495444444
504444345
511554354
524555444
535444344
544444455
554444444
565444344
574444444
584444444
595444445
604444444

Summary Data Outback

Nilai Mean dari data lebih besar dari nilai 3, atau RG


In [30]:
summary(DataOutback)


Out[30]:
      RRO          TampilanO     MenuO         PackagingO        WifiO      
 Min.   :1.000   Min.   :1   Min.   :1.000   Min.   :1.000   Min.   :2.000  
 1st Qu.:3.000   1st Qu.:4   1st Qu.:4.000   1st Qu.:4.000   1st Qu.:3.000  
 Median :3.500   Median :4   Median :4.000   Median :4.000   Median :4.000  
 Mean   :3.517   Mean   :4   Mean   :3.983   Mean   :3.967   Mean   :3.633  
 3rd Qu.:4.000   3rd Qu.:4   3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:4.000  
 Max.   :5.000   Max.   :5   Max.   :5.000   Max.   :5.000   Max.   :5.000  
  PembayaranO      PelayananO   
 Min.   :2.000   Min.   :2.000  
 1st Qu.:4.000   1st Qu.:4.000  
 Median :4.000   Median :4.000  
 Mean   :3.967   Mean   :4.067  
 3rd Qu.:4.000   3rd Qu.:4.000  
 Max.   :5.000   Max.   :5.000  

Korelasi:

Korelasi terbesar dengan Tingkat Kembali Konsumen (Retention Rate) adalah Wifi dan Pelayanan


In [31]:
cor(DataOutback)


Out[31]:
RROTampilanOMenuOPackagingOWifiOPembayaranOPelayananO
RRO1.00000000.10586850.16952640.22092890.36775990.19342740.3762248
TampilanO0.10586851.00000000.91268340.59376120.31087510.33399070.4254228
MenuO0.16952640.91268341.00000000.72828650.29310740.36353530.5045601
PackagingO0.22092890.59376120.72828651.00000000.29670420.42159380.4479432
WifiO0.36775990.31087510.29310740.29670421.00000000.58383730.4306561
PembayaranO0.19342740.33399070.36353530.42159380.58383731.00000000.4037383
PelayananO0.37622480.42542280.50456010.44794320.43065610.40373831.0000000

1. Hubungan Tampilan Interior dengan Retention Rate

Hubungan positif namun tidak signifikan


In [32]:
# qplot(DataOutback,
#       x = DataOutback$RRO,
#       y = DataOutback$TampilanO,
#       position = position_jitter(w = 0.1, h = 0.1),
#       xlab = "Retention Rate Outback",
#       ylab = "Tampilan Interior Outback",
#       main = "Hubungan Tampilan Interior dengan Retention Rate")

Gambar di atas dimodifikasi agar tidak bertumpuk, gambar di bawah adalah gambar hubungan asli Retention Rate dengan Tampilan


In [33]:
# qplot(x = RRO,
#       TampilanO,
#       data = DataOutback,
#       geom = c("point", "smooth"),
#       method = "lm",
#       xlab = "Retention Rate Outback",
#       ylab = "Tampilan Interior Outback",
#       main = "Hubungan Tampilan Interior dengan Retention Rate",
#       formula = y ~ x)

Hasil Regresi Retention Rate dengan Tampilan:

* Tampilan tidak signifikan mempengaruhi Retention Rate

* Tidak signifikan ditunjujan dengan nilai p-value 0.42 pada hasil dibawah


In [34]:
regression_RRO_TampilanO = lm(RRO ~ TampilanO, data = DataOutback)
summary(regression_RRO_TampilanO)


Out[34]:
Call:
lm(formula = RRO ~ TampilanO, data = DataOutback)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.65952 -0.51667  0.05476  0.48333  1.48333 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   2.9452     0.7150   4.119 0.000122 ***
TampilanO     0.1429     0.1762   0.811 0.420780    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.9323 on 58 degrees of freedom
Multiple R-squared:  0.01121,	Adjusted R-squared:  -0.00584 
F-statistic: 0.6574 on 1 and 58 DF,  p-value: 0.4208

2. Hubungan Tampilan Menu dengan Retention Rate

Hubungan positif namun tidak signifikan


In [35]:
# qplot(x = RRO,
#       y = MenuO,
#       data = DataOutback,
#       geom = c("point"),
#       position = position_jitter(w = 0.1, h = 0.1),
#       method = "lm",
#       xlab = "Retention Rate Outback",
#       ylab = "Menu Outback",
#       main = "Hubungan Tampilan Menu dengan Retention Rate",
#       formula = y ~ x)


In [36]:
# qplot(x = RRO,
#       y = MenuO,
#       data = DataOutback,
#       geom = c("point", "smooth"),
#       method = "lm",
#       xlab = "Retention Rate Outback",
#       ylab = "Menu Outback",
#       main = "Hubungan Tampilan Menu dengan Retention Rate",
#       formula = y ~ x)

Hasil Regresi Retention Rate dengan Tampilan Menu:

* Tampilan tidak signifikan mempengaruhi Retention Rate

* Tidak signifikan ditunjujan dengan nilai p-value 0.19 pada hasil dibawah


In [37]:
regression_RRO_MenuO = lm(RRO ~ MenuO, data = DataOutback)
summary(regression_RRO_MenuO)


Out[37]:
Call:
lm(formula = RRO ~ MenuO, data = DataOutback)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.74526 -0.52041  0.09201  0.47959  1.47959 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   2.6210     0.6940   3.777 0.000376 ***
MenuO         0.2248     0.1716   1.310 0.195349    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.924 on 58 degrees of freedom
Multiple R-squared:  0.02874,	Adjusted R-squared:  0.01199 
F-statistic: 1.716 on 1 and 58 DF,  p-value: 0.1953

3. Hubungan Tampilan Packaging dengan Retention Rate

Hubungan positif signifikan


In [38]:
# qplot(x = RRO,
#       y = PackagingO,
#       data = DataOutback,
#       geom = c("point"),
#       position = position_jitter(w = 0.1, h = 0.1),
#       xlab = "Retention Rate Outback",
#       ylab = "Packaging Outback",
#       main = "Hubungan Tampilan Packaging dengan Retention Rate",
#       formula = y ~ x)


In [39]:
# qplot(x = RRO,
#       y = PackagingO,
#       data = DataOutback,
#       geom = c("point", "smooth"),
#       method = "lm",
#       xlab = "Retention Rate Outback",
#       ylab = "Packaging Outback",
#       main = "Hubungan Tampilan Packaging Makanan dengan Retention Rate",
#       formula = y ~ x)

Hasil Regresi Retention Rate dengan Packaging:

* Packaging signifikan mempengaruhi Retention Rate pada alpha 10%

* Signifikansi ditunjukan dengan nilai p-value 0.089 pada hasil di bawah


In [40]:
regression_RRO_MenuO = lm(RRO ~ PackagingO, data = DataOutback)
summary(regression_RRO_MenuO)


Out[40]:
Call:
lm(formula = RRO ~ PackagingO, data = DataOutback)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.52699 -0.52699 -0.02699  0.47301  1.47301 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)   
(Intercept)   2.2879     0.7220   3.169  0.00244 **
PackagingO    0.3098     0.1796   1.725  0.08982 . 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.9144 on 58 degrees of freedom
Multiple R-squared:  0.04881,	Adjusted R-squared:  0.03241 
F-statistic: 2.976 on 1 and 58 DF,  p-value: 0.08982

4. Hubungan Wifi dengan Retention Rate

Hubungan positif signifikan


In [41]:
# qplot(x = RRO,
#       y = WifiO,
#       data = DataOutback,
#       geom = c("point"),
#       position = position_jitter(w = 0.1, h = 0.1),
#       xlab = "Retention Rate Outback",
#       ylab = "Wifi Outback",
#       main = "Hubungan Wifi dengan Retention Rate pada Outback",
#       formula = y ~ x)


In [42]:
# qplot(x = RRO,
#       y = WifiO,
#       data = DataOutback,
#       geom = c("point", "smooth"),
#       method = "lm",
#       xlab = "Retention Rate Outback",
#       ylab = "Wifi Outback",
#       main = "Hubungan Wifi dengan Retention Rate",
#       formula = y ~ x)

Hasil Regresi Retention Rate dengan Wifi:

* Wifi signifikan mempengaruhi Retention Rate pada alpha 1%

* Signifikansi ditunjukan dengan nilai p-value 0.003 pada hasil di bawah


In [43]:
regression_RRO_wifiO = lm(RRO ~ WifiO, data = DataOutback)
summary(regression_RRO_wifiO)


Out[43]:
Call:
lm(formula = RRO ~ WifiO, data = DataOutback)

Residuals:
    Min      1Q  Median      3Q     Max 
-2.2127 -0.6926 -0.1726  0.3074  1.7873 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)   
(Intercept)   1.7728     0.5898   3.006  0.00391 **
WifiO         0.4800     0.1594   3.012  0.00384 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.8719 on 58 degrees of freedom
Multiple R-squared:  0.1352,	Adjusted R-squared:  0.1203 
F-statistic: 9.071 on 1 and 58 DF,  p-value: 0.003843

5. Hubungan Pembayaran dengan Retention Rate

Hubungan positif tidak signifikan


In [44]:
# qplot(x = RRO,
#       y = PembayaranO,
#       data = DataOutback,
#       geom = c("point"),
#       position = position_jitter(w = 0.1, h = 0.1),
#       xlab = "Retention Rate Outback",
#       ylab = "Pembayaran Outback",
#       main = "Hubungan Servis Permbayaran dengan Retention Rate pada Outback",
#       formula = y ~ x)


In [45]:
# qplot(x = RRO,
#       y = PembayaranO,
#       data = DataOutback,
#       geom = c("point", "smooth"),
#       method = "lm",
#       xlab = "Retention Rate Outback",
#       ylab = "Service Pembayaran Outback",
#       main = "Hubungan Tampilan Menu dengan Retention Rate",
#       formula = y ~ x)

Hasil Regresi Retention Rate dengan Pembayaran:

* Wifi tidak signifikan mempengaruhi Retention Rate pada alpha 10%

* Tidak signifikannya variabel Pembayaran ditunjukan dengan nilai p-value 0.13 pada hasil di bawah


In [46]:
regression_RRO_PembayaranO = lm(RRO ~ PembayaranO, data = DataOutback)
summary(regression_RRO_PembayaranO)


Out[46]:
Call:
lm(formula = RRO ~ PembayaranO, data = DataOutback)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.79692 -0.52571 -0.02571  0.47429  1.74550 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)   
(Intercept)   2.4409     0.7263   3.361  0.00138 **
PembayaranO   0.2712     0.1806   1.501  0.13866   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.9199 on 58 degrees of freedom
Multiple R-squared:  0.03741,	Adjusted R-squared:  0.02082 
F-statistic: 2.254 on 1 and 58 DF,  p-value: 0.1387

6. Hubungan Pelayanan dengan Retention Rate

Hubungan positif signifikan


In [47]:
# qplot(x = RRO,
#       y = PelayananO,
#       data = DataOutback,
#       geom = c("point"),
#       position = position_jitter(w = 0.1, h = 0.1),
#       xlab = "Retention Rate Outback",
#       ylab = "Pelayanan Outback",
#       main = "Hubungan Pelayanan dengan Retention Rate pada Outback",
#       formula = y ~ x)


In [48]:
# qplot(x = RRO,
#       y = PelayananO,
#       data = DataOutback,
#       geom = c("point", "smooth"),
#       method = "lm",
#       xlab = "Retention Rate Outback",
#       ylab = "Pelayanan Outback",
#       main = "Hubungan Pelayanan dengan Retention Rate",
#       formula = y ~ x)

Hasil Regresi Retention Rate dengan Pembayaran:

* Pelayanan signifikan mempengaruhi Retention Rate pada alpha 10%

* signifikannya variabel Pembayaran ditunjukan dengan nilai p-value 0.003 pada hasil di bawah


In [49]:
regression_RRO_PelayananO = lm(RRO ~ PelayananO, data = DataOutback)
summary(regression_RRO_PelayananO)


Out[49]:
Call:
lm(formula = RRO ~ PelayananO, data = DataOutback)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.47635 -0.47635 -0.08108  0.52365  1.52365 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)   
(Intercept)   1.0574     0.8031   1.317  0.19313   
PelayananO    0.6047     0.1956   3.092  0.00305 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.8687 on 58 degrees of freedom
Multiple R-squared:  0.1415,	Adjusted R-squared:  0.1267 
F-statistic: 9.563 on 1 and 58 DF,  p-value: 0.00305

Analissa: Bagaimana Hubungan Keseluruhan Variabel dengan Retention Rate pada Outback?

* Hanya Wifi yang signifikan


In [50]:
reg_all <- lm(RRO ~ TampilanO + MenuO + PackagingO + WifiO + PembayaranO + PelayananO, data = DataOutback)
summary(reg_all)


Out[50]:
Call:
lm(formula = RRO ~ TampilanO + MenuO + PackagingO + WifiO + PembayaranO + 
    PelayananO, data = DataOutback)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.09035 -0.64604  0.07318  0.35396  1.78024 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)  
(Intercept)   0.9161     0.9645   0.950   0.3465  
TampilanO    -0.3720     0.4219  -0.882   0.3819  
MenuO         0.2064     0.4934   0.418   0.6775  
PackagingO    0.1389     0.2656   0.523   0.6030  
WifiO         0.4263     0.2046   2.084   0.0420 *
PembayaranO  -0.1615     0.2222  -0.727   0.4706  
PelayananO    0.4443     0.2445   1.817   0.0748 .
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.8657 on 53 degrees of freedom
Multiple R-squared:  0.2209,	Adjusted R-squared:  0.1327 
F-statistic: 2.505 on 6 and 53 DF,  p-value: 0.03299

7. Variabel apa saja yang signifikan dalam mempengaruhi Retention Rate?


In [51]:
library(leaps)
regsubsets.out <-regsubsets(RRO ~ TampilanO + MenuO + PackagingO + WifiO + PembayaranO + PelayananO,
               data = DataOutback,
               nbest = 1,       # 1 best model for each number of predictors
               nvmax = NULL,    # NULL for no limit on number of variables
               force.in = NULL, force.out = NULL,
               method = "exhaustive")
regsubsets.out


Out[51]:
Subset selection object
Call: regsubsets.formula(RRO ~ TampilanO + MenuO + PackagingO + WifiO + 
    PembayaranO + PelayananO, data = DataOutback, nbest = 1, 
    nvmax = NULL, force.in = NULL, force.out = NULL, method = "exhaustive")
6 Variables  (and intercept)
            Forced in Forced out
TampilanO       FALSE      FALSE
MenuO           FALSE      FALSE
PackagingO      FALSE      FALSE
WifiO           FALSE      FALSE
PembayaranO     FALSE      FALSE
PelayananO      FALSE      FALSE
1 subsets of each size up to 6
Selection Algorithm: exhaustive

In [52]:
summary.out <- summary(regsubsets.out)
as.data.frame(summary.out$outmat)


Out[52]:
TampilanOMenuOPackagingOWifiOPembayaranOPelayananO
1 ( 1 ) *
2 ( 1 ) * *
3 ( 1 )* * *
4 ( 1 )** * *
5 ( 1 )* ****
6 ( 1 )******

Analisa dengan Adjusted R square pada Multivariable Regression:

Variabel Wifi dan Pelayanan yang signifikan dan memberikan Adjusted R square tertinggi.


In [53]:
# plot(regsubsets.out, scale = "adjr2", main = "Adjusted R^2")

Variabel Wifi dan Pelayanan yang signifikan dan memberikan Adjusted R square tertinggi:

* Adjusted R square benilai 0.1652,

* p-value Wifi 0.06 signiifikan pada alpha 10%

* variabel pelayanan dengan p-value 0.047 signigfikan pada alpha 5%


In [54]:
reg_best <- lm(RRO ~ WifiO + PelayananO, data = DataOutback)
summary(reg_best)


Out[54]:
Call:
lm(formula = RRO ~ WifiO + PelayananO, data = DataOutback)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.27924 -0.60887  0.00582  0.39113  1.72076 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)  
(Intercept)   0.5708     0.8253   0.692   0.4920  
WifiO         0.3296     0.1720   1.916   0.0603 .
PelayananO    0.4299     0.2118   2.029   0.0471 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.8493 on 57 degrees of freedom
Multiple R-squared:  0.1935,	Adjusted R-squared:  0.1652 
F-statistic: 6.838 on 2 and 57 DF,  p-value: 0.002178

In [ ]:


In [ ]:


In [ ]: